<script setup>
import {markRaw, ref} from "vue";
import Home from "../components/Home.vue";
import User from "../components/User.vue";

let selectedComponent = ref(null)

function changeComponent(comp) {
  selectedComponent.value = markRaw(comp)
}
</script>

<template>
<button v-on:click="changeComponent(Home)">Home</button>
<button v-on:click="changeComponent(User)">User</button>

  <component v-bind:is="selectedComponent"></component>
</template>

<style scoped>

</style>